<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Admin</title>
	<link rel="stylesheet" type="text/css" href="JS/jquery_ui/jquery-ui.css"/>
	<link rel="stylesheet" type="text/css" href="css/main.css"/>
	<link rel="stylesheet" type="text/css" href="css/addOn.css"/>	
	<link rel="stylesheet" type="text/css" href="css/style.css"/>	
	<script type="text/javascript" src="JS/jquery_ui/jquery.js"></script>
	<script type="text/javascript" src="JS/jquery_ui/jquery-ui.js"></script>
	<script type="text/javascript" src="JS/ckeditor/ckeditor.js"></script>
	<link rel="stylesheet" type="text/css" href="css/style.css"/>	
	<script type="text/javascript" src="JS/script.js"></script>
	<!-- <script type="text/javascript" src="JS/validate_error.js"></script>  -->	
</head>
<body>
	<div class="r-main">
		<div class="r-header">
			<div class="site-left">
				<div class="menu">
					<ul>
						<li><a href="./PageLoad.article?rows=8&pages=1&keyword=" onclick="list()"><img src="Image/home.png"> <span>Home</span> </a></li>
							<%
								if(session.getAttribute("user")!=null && session.getAttribute("position").equals("admin")){
							%>
								<li><a href="report_article.jsp" onclick=""><img src="Image/report.png"> <span>Report</span> </a></li>
							<% 
								}
							%>
					</ul>
				</div>
			</div>
			<script type="text/javascript">
			function list_author(){
				window.location.href="./admin_load.jsp";
			}
			function list_article(){
				window.location.href="./author_load.jsp";
			}
			</script>
			<div class="site-right">
				<%! 
					private String s,firstLetter,restLetters,username,position;
				%>
				<%
			      if(session.getAttribute("user") !=null){
			    	  	s= (String)session.getAttribute("user") ;
					  firstLetter = s.substring(0,1).toUpperCase();
				      restLetters = s.substring(1).toLowerCase();
				       username=firstLetter + restLetters;
				       position=(String)session.getAttribute("position");
						if(position.equalsIgnoreCase("admin")){
					%>
						<h4 class="username" onclick="list_author()"><%=username%></h4>
					<% 
						}else if(position.equalsIgnoreCase("author")){
					%>
						<h4 class="username" onclick="list_article()"><%=username%></h4>
					<% 
						}
			      }
					%>
				<ul>
					<li><a href="#">Setting</a>
						<ul>
							<li><a href="admin_profile.jsp">Profile</a></li>						
							<li><a href="./logout.article">Logout</a></li>
						</ul>
					</li>
				</ul>
			</div>
		</div><!-- end header -->>